/**
 * 分销管理API
 */
import request from '/@/utils/request';

export function readDistributor(uid: string) {
  return request({
    url: `distributors/${uid}`,
    method: 'get'
  });
}

export function readAllDsitributor(params?: any) {
  return request({
    url: 'distributors',
    method: 'get',
    params,
  });
}

export function createDistributor(data: any) {
  return request({
    url: `distributors`,
    method: 'post',
    data,
  });
}

export function updateDistributor(id: string, data: any) {
  return request({
    url: `distributors/${id}`,
    method: 'patch',
    data,
  });
}

export function deleteDistributor(id: string) {
  return request({
    url: `distributors/${id}`,
    method: 'delete',
  });
}
